package main

import "fmt"

func calc(base int) (func(int) int, func(int) int) {
	add := func(i int) int {
		base += i
		return base
	}
	sub := func(i int) int {
		base -= i
		return base
	}
	return add, sub
}

func main() {
	f1, f2 := calc(10) // base = 10
	// fmt.Println(f1(10), f2(1))
	fmt.Println(f1(20), f2(20))
}
